package com.banana.scheduler;

import java.io.File;
import java.io.FileInputStream;
import java.util.List;
import java.util.Properties;

import com.banana.fetcher.Fetcher;

public class StartCrawler {
	public static void main(String[] args) throws Exception {
		
		Properties prop = new Properties();
		prop.load(new FileInputStream(new File(args[0])));
		Scheduler s = new Scheduler(prop);
		Fetcher f = new Fetcher(s);
		
		System.out.println("print");
		while (true) { 
			Thread.sleep(1000);
			List<SimpleJob> sj = f.fetch();
			for (SimpleJob j : sj) {
				System.out.println(j.getHtml().toString());
			}
		}
		
	}
}
